﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace X.WPF.Controls.Sample.Models
{
    /// <summary>
    /// 包裹模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Wrap<T> : INotifyPropertyChanged
    {
        /// <summary>
        /// 无参构造器
        /// </summary>
        public Wrap()
        {

        }

        /// <summary>
        /// 创建包裹模型构造器
        /// </summary>
        /// <param name="model">数据模型</param>
        public Wrap(T model)
        {
            this.Model = model;
        }

        /// <summary>
        /// 创建包裹模型构造器
        /// </summary>
        /// <param name="isSelected">是否选中</param>
        /// <param name="isChecked">是否勾选</param>
        /// <param name="model">数据模型</param>
        public Wrap(bool? isSelected, bool? isChecked, T model)
        {
            this.IsSelected = isSelected;
            this.IsChecked = isChecked;
            this.Model = model;
        }

        /// <summary>
        /// 是否选中
        /// </summary>
        public bool? IsSelected { get; set; }

        /// <summary>
        /// 是否勾选
        /// </summary>
        public bool? IsChecked { get; set; }

        /// <summary>
        /// 数据模型
        /// </summary>
        public T Model { get; set; }

        /// <summary>
        /// 属性变更事件
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;
    }
}
